<%--
  Created by IntelliJ IDEA.
  User: cnprinces
  Date: 13-1-29
  Time: 下午1:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include.inc.jsp" %>

<script type="text/javascript">
    function kkk() {
        var json = arguments[0], result = "";
//	alert(json.checked);

        $(json.items).each(function (i) {
            result += "<p>name:" + this.name + " value:" + this.value + " text: " + this.text + "</p>";
        });
        $("#resultBox").html(result);

    }
</script>

<div id="resultBox"></div>
<div style=" float:left; display:block; margin:10px; overflow:auto; width:200px; height:300px; border:solid 1px #CCC; line-height:21px; background:#FFF;">
    <%--
        <p>所有商品</p>
    --%>

    <form method="post" action="/basesetting/package!selectGoods" class="pageForm required-validate"
          onsubmit="return validateCallback(this, dialogAjaxDone)" novalidate="novalidate">

        <input type="hidden" name="goodsPackage.id" value="${goodsPackage.id}"/>
        <div class="buttonContent"><button type="submit">提交</button></div>

        <ul class="tree treeFolder treeCheck expand">
           <%-- <li><a>框架面板</a>
                <ul>
                    <li><a tname="name" tvalue="value1" checked="true">我的主页</a></li>
                </ul>
            </li>--%>
            <c:forEach items="${parentRes}" var="res">
                <li><a tname="name" tvalue="test1">${res.goodsName}</a>
                    <ul>
                        <c:forEach items="${list}" var="ress">
                            <c:if test="${ress.parentId==res.id}">
                                <li><a tname="name" tvalue="test1.1">${ress.goodsName}</a>
                                    <ul>
                                        <c:forEach items="${goodsList}" var="goods">
                                            <c:if test="${goods.typeId==ress.id}">
                                                <li><a tname="goodsList" tvalue="${goods.id}" target="ajax"
                                                       <c:forEach var="goodsByPackage" items="${goodsByPackage}">
                                                           <c:if test="${goodsByPackage.id==goods.id}">
                                                               checked="true"
                                                           </c:if>
                                                       </c:forEach>
                                                       rel="selectGoods"
                                                       href="/basesetting/package!goodsInfo?goodsInfo.id=${goods.id}">${goods.goodsName}</a>
                                                </li>
                                            </c:if>
                                        </c:forEach>
                                    </ul>
                                </li>
                            </c:if>
                        </c:forEach>
                    </ul>
                </li>
            </c:forEach>
        </ul>
<%--
        <input type="submit" value="Submit">
--%>

    </form>
</div>

<div id="selectGoods" class="unitBox" style="margin-left:246px;">
    <!--#include virtual="list1.html" -->
</div>